from dictionary.models import Dictionary, DictionaryDetail
from dictionary.model_serializers import DictionarySerializer, DictionaryDetailSerializer
from utils.mixins.common_mixins.filters import AllLookupsFilterBackend
from utils.mixins.common_mixins.requests import LogicalDeleteModelViewSet


class DictionaryViewSet(LogicalDeleteModelViewSet):
    queryset = Dictionary.objects.filter(is_deleted=False)
    serializer_class = DictionarySerializer
    filter_backends = (AllLookupsFilterBackend,)
    filterset_fields = '__all__'


class DictionaryDetailViewSet(LogicalDeleteModelViewSet):
    queryset = DictionaryDetail.objects.filter(is_deleted=False)
    serializer_class = DictionaryDetailSerializer
    filter_backends = (AllLookupsFilterBackend,)
    filterset_fields = '__all__'
